from django.db import models

# Create your models here.
class Good(models.Model):
    Gid = models.AutoField(primary_key=True)
    title = models.CharField(max_length=255)
    description = models.TextField(blank=True)
    price = models.DecimalField(max_digits=10, decimal_places=2)
    images = models.JSONField(blank=True, null=True)
    uid = models.ForeignKey('personal_manage.MyUser', on_delete=models.CASCADE)
    status = models.SmallIntegerField() # 1: available, 0: sold out
    view_count = models.IntegerField()

    class Meta:
        db_table = 'goods' 